import { post, get, _delete, put } from '@/lin/plugin/axios'

class MonitoringDevices {
  static async addMonitoringDevices(data) {
    const res = await post('v1/ag/monitoringdevices/create', data)
    return res
  }

  static async getMonitoringDevice(id) {
    const res = await get(`v1/ag/monitoringdevices/${id}`)
    return res
  }

  static async editMonitoringDevices(id, data) {
    const res = await put(`/v1/ag/monitoringdevices/${id}`, data)
    return res
  }

  static async deleteMonitoringDevices(id) {
    const res = await _delete(`/v1/ag/monitoringdevices/${id}`)
    return res
  }

  static async getMonitoringDevices(page = 0, count = 10) {
    const res = await get('/v1/ag/monitoringdevices/page', { page, count })
    return res
  }

  // static async getMonitoringDevicesList() {
  //   const res = await get('/v1/ag/MonitoringDevices/list')
  //   return res
  // }
  static async search({ keyword, page, count }) {
    const res = await get('v1/ag/monitoringdevices/search', {
      keyword,
      page,
      count,
    })
    return res
  }
}

export default MonitoringDevices
